package wht.jly.forum.config.querydsl;

import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.persistence.EntityManager;

/**
 * querydsl 配置
 *
 * @author lanyangji
 * @date 2019/2/8 19:30
 */
@Configuration
public class QuerydslConfig {

    /**
     * 注入 jpaQueryFactory
     *
     * @param entityManager
     * @return
     */
    @Bean
    public JPAQueryFactory jpaQueryFactory(EntityManager entityManager) {
        return new JPAQueryFactory(entityManager);
    }

}
